import request from "../request.js"
import cfg from "../config.js"
import utils from "../utils.js"
import page_ext from "../page/crud_page_ext.js"

let page_type = {
    open: function (page_info) {
        let page_html_id=page_info.page_html_id;
        let property=page_info.property;
        let ext_js=page_info.ext_js;
        let page_id=page_info.page_id;
        let rights=page_info.rights;
        let login_info=page_info.login_info;
        let params=page_info.params;
        $("#" + page_html_id).addClass("row");
        $("#" + page_html_id).html("\
        <div class='col-md-12 col-sm-12 col-xs-12'>\
            <script>var view; $(function(){view=$('#" + page_html_id + " .view-part');})</script>\
            <div class='view-part'></div>\
        </div>");

        let _html = property.page;
        let _view = $('#' + page_html_id + ' .view-part');
        _view.html(_html);

        //----extjs----
        let extjs = page_ext[ext_js] ? page_ext[ext_js] : {}; //页面定制代码
        extjs.page_info=page_info;
        if (extjs.after_build_view) {
            extjs.after_build_view(_view);
        }
    }
}

export default page_type;